print("hello word")
print(2024)
print (3.14)

name="Alice"
age=25
height=1.68
print("\n变量值")
print(name)
print(age)
print(height)

a=10
b=3
print("除法:",a/b)

pi=3.14159
radius=2.5
area=pi*radius**2
print("\n浮点数运算")
print("圆面积:",area)

message="Python学习"
print("\n字符串操作:")
print("首字母大写:",message[0].upper()+message[1:])
print("字符串长度",len(message))
print("重复字符串:",message*2)

print("\n类型转换:")
num_str="100"
print("字符串整数:",int(num_str)+5)
print("整数转字符串:","数值:"+str(age))

print(f"\n格式化输出:{name}今年{age}岁,身高{height:2f}米")

name="小明"
age=18
print(name,"今年",age,"岁")

print(f"{name}明年将满{age+1}岁")

print("2024","07","01",sep="-")

x,y,z,=10,20.5,"三角形"
print(f"\n形状:{z},底:{x},高:{y},面积:{0.5*x+y}")

a="苹果"
b="香蕉"
print(f"\n'交换前:a={a},b={b}")
a,b=b,a
print(f"交换后:a={a},b={b}")


big_nim=10_000_000
print("\n大数字:" ,big_nim)


pi=3.1415926535
print("圆周率:")
print("默认:",pi)
print("保留两位",round(pi,2))
print("格式化输出:{:.3f}".format(pi))


text="python编程很有趣"
print("\n字符串操作:")
print("长度:",len(text))
print("切片:",text[0:6])
print("倒叙:",text[::-1])
print("查找'趣':","趣" in text)

score="95"
print("\n类型转换:")
print("字符串转整数:",int(score)+5)
print("整数转浮点数:",float(100))


print("\n类型检查:")
print(type(10))
print(type(3.14))
print(type("文本"))


print("\n=====超市收据======")
item1,price1="苹果",8.5
item2,price2="牛奶",12.0
item3,price3="面包",6.8


print(f"{item1:10}{price1:>6.1f}元")
print(f"{item2:10}{price2:>6.1f}元")
print(f"{item3:10}{price3:>6.1f}元")
print("-"*20)
total=price1 +price2 + price3
print(f"{'总计':10}{total:>6.1f}元")
print(f"{'总计':10}{total:>6.1f}元")